﻿using NUnit.Framework;
using SharpRomans.ParsingRules;
using SharpRomans.Tests.ParsingRules.Support;

namespace SharpRomans.Tests.ParsingRules
{
	[TestFixture]
	public class FigurableCharacterTester : RuleTesterBase
	{
		[Test]
		public void SingleNonFigure_Exception()
		{
			string literal = "W";

			Assert.That(() => Observe<FigurableCharacter>(literal),
				ThrowsWhenParsing(literal, 0));
		}

		[Test]
		public void MultipleContainingNonFigure_Exception()
		{
			string literal = "XLW";

			Assert.That(() => Observe<FigurableCharacter>(literal),
				ThrowsWhenParsing(literal, 2));
		}

		[Test]
		public void MultipleRomanFigures_NoException()
		{
			string literal = "XIL";

			Assert.That(() => Observe<FigurableCharacter>(literal), Throws.Nothing);
		}
	}
}
